<?php
error_reporting(E_ALL|E_STRICT);
include('./app/config.inc.php');
ini_set('display_errors',Debug);

date_default_timezone_set('Asia/Chongqing');

set_include_path('.'. PATH_SEPARATOR . './library/'
					. PATH_SEPARATOR . BASE_DIR . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR
                    . PATH_SEPARATOR . BASE_DIR . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR
					. PATH_SEPARATOR . get_include_path());

include("Zend/Loader.php");
Zend_Loader::registerAutoload();

$config = new Zend_Config_Ini(BASE_DIR.'/config.ini','general');//for mysql
//$config = new Zend_Config_Ini('../app/config.ini','mssql');//for home pc mssql
//$config = new Zend_Config_Ini('../app/config.ini','officemssql');//for office pc mssql
//$registry = Zend_registry::getInstance();
//$registry->set('config', $config);

$db = Zend_Db::factory($config->db);
$db->query("set names 'utf8'");
Zend_Db_Table::setDefaultAdapter($db);

$fc = Zend_Controller_Front::getInstance();
$fc->throwExceptions(Debug);
$fc->setControllerDirectory(BASE_DIR.'/controllers');
//Zend_Layout::startMvc(array('layoutPath' => '../app/layouts'));


//try {
    $fc->dispatch();
//}catch(Exception $e){
    //var_dump($e->getMessage());
//}


